@include "euclid.awk"
@include "reader.awk"
@include "sorter.awk"

BEGIN { 
    FS=","
    euclidTest("../data/weather.dvs") 
}
function euclidTest(f,  t,r,c,out,sep,d,s,b) {
    lines(f,t)  
    for(r=t["rows"];r>=1;r--) 
         d[r]=dist(t,1,r)
    sorted(d,s)
    for(b=length(s["best"]); b>=1; b--) {
       r=best2key(s,b)
       o(t[r],"row " r " distance to 1 = " best2val(s,b));
}}
